import require from './require'

/**
 * 
 * @param {*} model 
 * @returns 获取列表
 */
export const getroles=(model)=>require.get('roles',model)

/**
 * 
 * @param {*} model 
 * @returns 添加用户
 */
export const roleslist=(model)=>require.post('roles',model)

/**
 * 
 * @param {*} model 
 * @returns 获取权限列表
 */
export const getroleslist=(model)=>require.get('rights/list',model)

/**
 * 
 * @param {*} model 
 * @returns 修改列表
 */
export const updataroleslist=(model)=>require.get(`rights/${model.id}`,model)

/**
 * 
 * @param {*} id 
 * @returns 删除接口
 */
export const deletelist=(id)=>require.delete(`roles/${id}`)
/**
 * 
 * @param {*} model 
 * @returns 分配权限树状图
 */
 export const gettree=(model)=>require.get('rights/tree',model)

 /**
  * 点击分配修改权限
  */
 export const updatatree=(id,keys)=>require.post(`roles/${id}/rights`,{keys})


 /**
  * 删除标签
  */
 export const deletetree=(id,rid)=>require.delete(`roles/${id}/rights/${rid}`)